import axios from '@/api/fetch';
// import * as types from './types';
import SERVER from '@/api/server';

// 表格数据
export const getDiscountmodes = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes`, { params });

// 明细查询
export const getDiscountmodesDetail = (id, params) => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes/detail/${id}`, { params });

// 修改明细
export const updataDiscountmodes = (id, params) => axios.put(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes/modifyByCode/${id}`, params);

// 新增数据
export const addDiscountmodes = params => axios.post(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes`, params);

// 新建查询系统生成优惠模式代码
export const getDiscountModeCod = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedata/discountmodes/getDiscountModeCode`, { params });
/* // 品牌 - 下拉框
export const getPinpSelect = params => axios.get(`/dms.web/customer/rest/customerManage/customerManager/brandsdicts`, { params });

// 车系 - 下拉框
export const getChexSelect = (id, params) => axios.get(`/dms.web/manage/rest/basedata/brandsdictC/${id}/seriessdictC`, { params });


// 维修备件列表
export const getWxpjList = (row, params) => {
  function toZero(flag) {
    return flag === null || flag === '' ? 0 : flag;
  }
  return axios.get(
    `${SERVER.DMSCLOUD_FINANCE}/basedata/repairProject/findRepairProjectItem/${toZero(row.MODEL_LABOUR_CODE)}/${toZero(row.LABOUR_CODE)}/${toZero(row.DOWN_TAG)}/${toZero('3LN6L5EN5HR641574')}`,
    { params }
  );
};
 */
